CREATE TABLE [dbo].[App_presup_det]
(
[id_presup] [dbo].[_codigo] NOT NULL,
[item] [dbo].[_codigo] NOT NULL,
[id_articulo] [dbo].[_codigo] NULL,
[descripcion] [dbo].[_nombre] NULL,
[precio] [dbo].[_importe] NULL,
[cantidad] [int] NOT NULL CONSTRAINT [DF__App_presu__canti__6521F869] DEFAULT ((1))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[App_presup_det] ADD CONSTRAINT [PK_presup_det] PRIMARY KEY CLUSTERED  ([id_presup], [item]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[App_presup_det] ADD CONSTRAINT [FK_App_presup_det_App_articulo] FOREIGN KEY ([id_articulo]) REFERENCES [dbo].[App_articulo] ([id_articulo])
GO
ALTER TABLE [dbo].[App_presup_det] ADD CONSTRAINT [FK_presup_det_presup_cab] FOREIGN KEY ([id_presup]) REFERENCES [dbo].[App_presup_cab] ([id_presup])
GO
EXEC sp_bindefault N'[dbo].[cero]', N'[dbo].[App_presup_det].[precio]'
GO
